import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import pinia from '@/stores/index'

import '@/assets/main.scss'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'


const app = createApp(App)

app.use(createPinia())
app.use(ElementPlus)
app.use(pinia)
app.use(router)

app.config.globalProperties.$filters = {
  formatRole(role) {
    switch(role) {
      case 'customer_service': return '客服专员'
      case 'reviewer': return '内容审核员'
      case 'editor': return '责任编辑'
      case 'super_admin': return '系统管理员'
      default: return role
    }
  }
}

app.mount('#app')
